package com.ztgf.shopping.mapper.shop;

import com.baomidou.mybatisplus.mapper.BaseMapper;
import com.baomidou.mybatisplus.plugins.Page;
import com.ztgf.order.models.dto.OrderInfoDTO;
import com.ztgf.shopping.models.bo.shop.*;
import com.ztgf.shopping.models.dto.audit.AuditDTO;
import com.ztgf.shopping.models.dto.shop.ShopInfoDTO;
import com.ztgf.shopping.models.vo.shop.*;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * 店铺表映射
 *
 * @author zhanghualang
 * @Date 2020-05-28 14:35:39
 */
@Mapper
public interface ShopInfoMapper extends BaseMapper<ShopInfoDTO> {
    ShopInfoDTO getByMobileName(@Param("name") String name, @Param("mobile") String mobile);

    List<ShopInfoManageVO> queryPageList(Page<ShopInfoManageVO> page, @Param("item") ShopInfoBO bo);

    Integer getVerifyOrder(@Param("id") Long id); //查询未走完流程的订单

    List<ShopInfoAbnormalVO> queryAbnormaPageList(Page<ShopInfoAbnormalVO> page, @Param("item") ShopInfoBO bo); //异常店铺列表 后台使用

    List<ShopInfoAllVO> queryAllList(Page<ShopInfoAllVO> page, @Param("item") ShopInfoAllBO bo); //用户列表

    ShopInfoUseStatisticsVO getUseStatistics(@Param("id") Long id); //用户统计

    ShopInfoTypeVO queryInfoByType(@Param("type") Integer type);

    List<ShopInfoVO> queryList(@Param("item") ShopInfoQueryBO bo);

    List<ShopInfoDTO> queryApiPageList(Page<ShopInfoDTO> page, @Param("type") String[] type, @Param("areaIds") String[] areaIds, @Param("initials") String[] initials);

    ShopInfoTypeVO queryInfoByIds(@Param("ids") String[] shopIds);

    ShopInfoVO getDKInfo(@Param("item") ShopInfoDKBO bo);

    List<ShopInfoVO> getByShopIds(List<Long> shopIdList);

    List<ShopInfoAbnormalVO> queryFrozenPageList(Page<ShopInfoAbnormalVO> page, @Param("item") ShopInfoBO bo); //冻结店铺列表 后台使用

    /**
     * @return : com.ztgf.shopping.models.dto.audit.AuditDTO
     * @Author :chenyu.wang
     * @Description : 获取最近一次开店审核通过的信息
     * @Date : 09:56 2021.01.20
     * @Param : [shopId]
     **/
    AuditDTO getOpenShopMessage(@Param("shopId") Long shopId);

    /**
     * @return : java.lang.Integer
     * @Author :chenyu.wang
     * @Description : 修改变更时间为空值
     * @Date : 2021.01.27 16:26
     * @Param : [shopId]
     **/
    Integer updateChangeTime(@Param("shopId") Long shopId);

    /**
     * @Author :liyang
     * @Description :根据条件（ids，type状态 0全部用户，1全部店铺(包含子账户)，2全部旗舰店，3全部专卖店，4全部专营店，5全部买家（全部注册用户））,查询用户信息
     * @param shopIds
     * @param type
     * @param pageNum
     * @param pageSize
     * @return
     */
    List<ShopInfoTypeVO> queryshopInfoByType(@Param ("shopIds") String shopIds,@Param ("type")Integer type, @Param ("pageNum")Integer pageNum, @Param ("pageSize")Integer pageSize);

    List<ShopInfoVO> queryPageListByNoticeId(Page<ShopInfoVO> page,@Param ("item")ShopInfoQueryBO bo);

    ShopInfoDTO getByUserId(@Param("userId") Long userId);

    List<ShopOverdueVO> queryOverdueList(Page<ShopOverdueVO> page, @Param ("item")ShopOverdueBO bo);

    List<OrderInfoDTO> slectOrderByShopId(@Param ("id") Long id);
}
